// To parse this JSON data, do
//
//     final categoryModel = categoryModelFromJson(jsonString);

import 'dart:convert';

List<CategoryModel> categoryModelFromJson(String str) => List<CategoryModel>.from(json.decode(str).map((x) => CategoryModel.fromJson(x)));

String categoryModelToJson(List<CategoryModel> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));

class CategoryModel {
  String categoryName;
  int categoryId;
  String categoryDesc;

  CategoryModel({
    required this.categoryName,
    required this.categoryId,
    required this.categoryDesc,
  });

  CategoryModel copyWith({
    String? categoryName,
    int? categoryId,
    String? categoryDesc,
  }) =>
      CategoryModel(
        categoryName: categoryName ?? this.categoryName,
        categoryId: categoryId ?? this.categoryId,
        categoryDesc: categoryDesc ?? this.categoryDesc,
      );

  factory CategoryModel.fromJson(Map<String, dynamic> json) => CategoryModel(
    categoryName: json["categoryName"]??"",
    categoryId: json["categoryId"]??0,
    categoryDesc: json["categoryDesc"]??"",
  );

  Map<String, dynamic> toJson() => {
    "categoryName": categoryName,
    "categoryId": categoryId,
    "categoryDesc": categoryDesc,
  };
}
